﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CommonLib {
    public class Scene {
        private List<Primitive> primitive;
        public Scene()
        {
            this.primitive = new List<Primitive>();
            initialize();
        }

        private void initialize() {
            Primitive plane01 = new Plane(new Vector3(0, -4.4, 0), new Vector3(0, 1, 0), false);
            plane01.Material.Color.set(0.4, 0.3, 0.3);
            plane01.Material.Reflection = 0;
            plane01.Material.Diffuse = 1.0;
            primitive.Add(plane01);

            Primitive plane02 = new Plane(new Vector3(6, 0, 0), new Vector3(-1, 0, 0), false);
            plane02.Material.Color.set(0.0, 0.0, 0.7);
            plane02.Material.Reflection = 0;
            plane02.Material.Diffuse = 1.0;
            primitive.Add(plane02);

            Primitive sphere01 = new Sphere(new Vector3(1.0, -0.8, 3.0), 2.5, false);
            sphere01.Material.Color.set(0.7, 1.0, 0.7);
            sphere01.Material.Diffuse = 1.0;
            primitive.Add(sphere01);

            Primitive sphere02 = new Sphere(new Vector3(-5.5, -0.5, 7), 2, false);
            sphere02.Material.Color.set(0.7, 0.7, 1.0);
            sphere02.Material.Diffuse = 0.1;
            sphere02.Material.Reflection = 1.0;
            primitive.Add(sphere02);

            Primitive light01 = new Sphere(new Vector3(0, 5, 5), 0.1, true);
            light01.Material.Color.set(0.6, 0.6, 0.6);
            primitive.Add(light01);

            Primitive light02 = new Sphere(new Vector3(2, 5, 1), 0.1, true);
            light02.Material.Color.set(0.7, 0.7, 0.9);
            primitive.Add(light02);

            Primitive light03 = new Sphere(new Vector3(-2, 0, 1), 0.1, true);
            light03.Material.Color.set(0.9, 0.7, 0.7);
            primitive.Add(light03);
        }
        public int CountPrimitive() {
            return primitive.Count;
        }
        public Primitive GetPrimitive(int index) {
            return primitive[index];
        }
    }
}
